package auftrag;

import java.util.ArrayList;

public class Variante {
	private String mName;
	private Produkt mParent;
	private int nNextOp = 0;
	private ArrayList<Operation> mOperations = new ArrayList<Operation>();
	
	public Variante(Produkt p, String s){
		mParent = p;
		mName = s;
	}
	
	public Produkt getParent(){
		return mParent;
	}
	
	public void addOperation(Operation o){
		mOperations.add(o);
	}
	
	public Operation getNextOperation(){
		if(mOperations.size() > nNextOp){
			nNextOp++;
			return mOperations.get(nNextOp-1);
		}
		return null;
	}
	
	public boolean hasNextOperation(){
		return mOperations.size() > nNextOp;
	}
	
	@Override
	public String toString(){
		return mName;
	}
}
